package com.yonyou.pmclouds.safetypatrol.process;

import com.yonyou.pmclouds.basecom.bp.processor.MultiProcessor;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.safetypatrol.entity.SafetypatrolDetailVO;

import java.util.HashSet;
import java.util.Set;

/**
 * @author xu
 */
public class SafeDetailAddCheckProcess implements MultiProcessor<SafetypatrolDetailVO> {

    @Override
    public void process(SafetypatrolDetailVO[] vos, SafetypatrolDetailVO[] origs) throws BusinessException {
        Set<String> set =new HashSet<>();
        for (SafetypatrolDetailVO vo : vos) {
            set.add(vo.getCheckname());
        }
        if (set.size()!=vos.length){
            throw new BusinessException("同一检查标准下不可以有相同的检查项");
        }
    }
}
